<?php

namespace App\Http\Controllers\Admin;

use App\MemberPrize;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class MemberPrizeController extends Controller
{
    public function index(Request $request){
        //dd(111);
        return view('admin.memberPrize.list');
    }
    public function ajax_list(Request $request){
        $model= MemberPrize::with('member');
        if($request->searchKey){
            $model=$model->where('name','like', '%'.$request->searchKey.'%')
            ->orderBy('created_at desc');
        }
        $model=$model->paginate($request->limit)
            ->toArray();
        return $this->page_json_render($model);
    }
}
